3.9.9 \(\int \frac {(f+g x)^n (a+2 c d x+c e x^2)}{d+e x} \, dx\) [809]

Optimal. Leaf size=114 \[ -\frac {c (e f-d g) (f+g x)^{1+n}}{e g^2 (1+n)}+\frac {c (f+g x)^{2+n}}{g^2 (2+n)}+\frac {\left (c d^2-a e\right ) (f+g x)^{1+n} \, _2F_1\left (1,1+n;2+n;\frac {e (f+g x)}{e f-d g}\right )}{e (e f-d g) (1+n)} \]

[Out]

-c*(-d*g+e*f)*(g*x+f)^(1+n)/e/g^2/(1+n)+c*(g*x+f)^(2+n)/g^2/(2+n)+(c*d^2-a*e)*(g*x+f)^(1+n)*hypergeom([1, 1+n]
,[2+n],e*(g*x+f)/(-d*g+e*f))/e/(-d*g+e*f)/(1+n)

________________________________________________________________________________________

Rubi [A]
time = 0.09, antiderivative size = 114, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.107, Rules used = {965, 81, 70} \begin {gather*} \frac {\left (c d^2-a e\right ) (f+g x)^{n+1} \, _2F_1\left (1,n+1;n+2;\frac {e (f+g x)}{e f-d g}\right )}{e (n+1) (e f-d g)}-\frac {c (e f-d g) (f+g x)^{n+1}}{e g^2 (n+1)}+\frac {c (f+g x)^{n+2}}{g^2 (n+2)} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[((f + g*x)^n*(a + 2*c*d*x + c*e*x^2))/(d + e*x),x]

[Out]

-((c*(e*f - d*g)*(f + g*x)^(1 + n))/(e*g^2*(1 + n))) + (c*(f + g*x)^(2 + n))/(g^2*(2 + n)) + ((c*d^2 - a*e)*(f
 + g*x)^(1 + n)*Hypergeometric2F1[1, 1 + n, 2 + n, (e*(f + g*x))/(e*f - d*g)])/(e*(e*f - d*g)*(1 + n))

Rule 70

Int[((a_) + (b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[(b*c - a*d)^n*((a + b*x)^(m + 1)/(b^(
n + 1)*(m + 1)))*Hypergeometric2F1[-n, m + 1, m + 2, (-d)*((a + b*x)/(b*c - a*d))], x] /; FreeQ[{a, b, c, d, m
}, x] && NeQ[b*c - a*d, 0] &&  !IntegerQ[m] && IntegerQ[n]

Rule 81

Int[((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Simp[b*(c + d*x)^
(n + 1)*((e + f*x)^(p + 1)/(d*f*(n + p + 2))), x] + Dist[(a*d*f*(n + p + 2) - b*(d*e*(n + 1) + c*f*(p + 1)))/(
d*f*(n + p + 2)), Int[(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n, p}, x] && NeQ[n + p + 2,
0]

Rule 965

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))^(n_)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :
> Simp[c^p*(d + e*x)^(m + 2*p)*((f + g*x)^(n + 1)/(g*e^(2*p)*(m + n + 2*p + 1))), x] + Dist[1/(g*e^(2*p)*(m +
n + 2*p + 1)), Int[(d + e*x)^m*(f + g*x)^n*ExpandToSum[g*(m + n + 2*p + 1)*(e^(2*p)*(a + b*x + c*x^2)^p - c^p*
(d + e*x)^(2*p)) - c^p*(e*f - d*g)*(m + 2*p)*(d + e*x)^(2*p - 1), x], x], x] /; FreeQ[{a, b, c, d, e, f, g}, x
] && NeQ[e*f - d*g, 0] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0] && IGtQ[p, 0] && NeQ[m + n + 2*
p + 1, 0] && (IntegerQ[n] ||  !IntegerQ[m])

Rubi steps

\begin {align*} \int \frac {(f+g x)^n \left (a+2 c d x+c e x^2\right )}{d+e x} \, dx &=\frac {c (f+g x)^{2+n}}{g^2 (2+n)}+\frac {\int \frac {(f+g x)^n (-e g (c d f-a g) (2+n)-c e g (e f-d g) (2+n) x)}{d+e x} \, dx}{e g^2 (2+n)}\\ &=-\frac {c (e f-d g) (f+g x)^{1+n}}{e g^2 (1+n)}+\frac {c (f+g x)^{2+n}}{g^2 (2+n)}-\frac {\left (c d^2-a e\right ) \int \frac {(f+g x)^n}{d+e x} \, dx}{e}\\ &=-\frac {c (e f-d g) (f+g x)^{1+n}}{e g^2 (1+n)}+\frac {c (f+g x)^{2+n}}{g^2 (2+n)}+\frac {\left (c d^2-a e\right ) (f+g x)^{1+n} \, _2F_1\left (1,1+n;2+n;\frac {e (f+g x)}{e f-d g}\right )}{e (e f-d g) (1+n)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.34, size = 125, normalized size = 1.10 \begin {gather*} \frac {(f+g x)^n \left (\frac {c \left (\frac {d g (f+g x)}{e}+\frac {f g n x+g^2 (1+n) x^2+f^2 \left (-1+\left (1+\frac {g x}{f}\right )^{-n}\right )}{2+n}\right )}{g^2}+\frac {\left (c d^2-a e\right ) (f+g x) \, _2F_1\left (1,1+n;2+n;\frac {e (f+g x)}{e f-d g}\right )}{e (e f-d g)}\right )}{1+n} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[((f + g*x)^n*(a + 2*c*d*x + c*e*x^2))/(d + e*x),x]

[Out]

((f + g*x)^n*((c*((d*g*(f + g*x))/e + (f*g*n*x + g^2*(1 + n)*x^2 + f^2*(-1 + (1 + (g*x)/f)^(-n)))/(2 + n)))/g^
2 + ((c*d^2 - a*e)*(f + g*x)*Hypergeometric2F1[1, 1 + n, 2 + n, (e*(f + g*x))/(e*f - d*g)])/(e*(e*f - d*g))))/
(1 + n)

________________________________________________________________________________________

Maple [F]
time = 0.03, size = 0, normalized size = 0.00 \[\int \frac {\left (g x +f \right )^{n} \left (c e \,x^{2}+2 c d x +a \right )}{e x +d}\, dx\]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((g*x+f)^n*(c*e*x^2+2*c*d*x+a)/(e*x+d),x)

[Out]

int((g*x+f)^n*(c*e*x^2+2*c*d*x+a)/(e*x+d),x)

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*x+f)^n*(c*e*x^2+2*c*d*x+a)/(e*x+d),x, algorithm="maxima")

[Out]

integrate((c*x^2*e + 2*c*d*x + a)*(g*x + f)^n/(x*e + d), x)

________________________________________________________________________________________

Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*x+f)^n*(c*e*x^2+2*c*d*x+a)/(e*x+d),x, algorithm="fricas")

[Out]

integral((c*x^2*e + 2*c*d*x + a)*(g*x + f)^n/(x*e + d), x)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\left (f + g x\right )^{n} \left (a + 2 c d x + c e x^{2}\right )}{d + e x}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*x+f)**n*(c*e*x**2+2*c*d*x+a)/(e*x+d),x)

[Out]

Integral((f + g*x)**n*(a + 2*c*d*x + c*e*x**2)/(d + e*x), x)

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*x+f)^n*(c*e*x^2+2*c*d*x+a)/(e*x+d),x, algorithm="giac")

[Out]

integrate((c*x^2*e + 2*c*d*x + a)*(g*x + f)^n/(x*e + d), x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {{\left (f+g\,x\right )}^n\,\left (c\,e\,x^2+2\,c\,d\,x+a\right )}{d+e\,x} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((f + g*x)^n*(a + 2*c*d*x + c*e*x^2))/(d + e*x),x)

[Out]

int(((f + g*x)^n*(a + 2*c*d*x + c*e*x^2))/(d + e*x), x)

________________________________________________________________________________________